package day10;

import javax.swing.text.Style;
import java.util.Arrays;
import java.util.Date;
import java.util.Random;
import java.util.Scanner;

public class Homework {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.print("请输入0~999的整数：");
        int num=sc.nextInt();
        if (num/10==0){
            System.out.println("该整数为："+0+0+num);
        }else if (num/100==0){
            System.out.println("该整数为："+0+num);
        }else {
            System.out.println("该整数为："+num);
        }
    }
}


class Paixu{
    public static void main(String[] args) {
        String str[]={"nba","abc","AB","cab","123","aaaa","z","qq"};
        for (int i=0;i<str.length-1;i++){
            for (int j=0;j<str.length-1-i;j++) {
                int n=str[j].compareTo(str[j+1]);
                if (n>0){
                    String st=str[j];
                    str[j]=str[j+1];
                    str[j+1]=st;
                }
            }
        }
        System.out.println(Arrays.toString(str));
    }
}


class Type{
    public static void main(String[] args) {
        String strs[]={"<",">","#","@","$","%","&"};
        StringBuilder str=new StringBuilder();
        Random rd=new Random();
        Scanner sc=new Scanner(System.in);
        System.out.print("请输入游戏的级别（1~6）：");
        int n=sc.nextInt();
        if (n>0 && n<7){
            for (int i=0;i<n+1;){
                int s= rd.nextInt(n+1);
                str.append(strs[s]);
                i++;
            }
        }else {
            System.out.println("输入错误！");
            return;
        }
        System.out.println("第"+n+"级游戏的内容为："+str);
    }
}

class Count{
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.print("请输入字符串：");
        String str1 = sc.next();
        System.out.print("请输入子字符串：");
        String str2 = sc.next();
        int count = 0;
        int index = 0;
        while ((index = str1.indexOf(str2, index)) != -1) {
            count++;
            index += str2.length();
        }
        System.out.println("出现次数: " + count);
    }
}

class test{
    public static void main(String[] args) {
        String s="abcdabceabrabcdf";
        String s2="abc";
        int a=0;
        int b=0;
        while ((b=s.indexOf(s2,b))!=-1){
            a++;
            b+=s2.length();
        }
        System.out.print(a);
        Date d=new Date();
        System.out.println(d);
    }
}